package cn.hebutrun.oulabot.common;

import lombok.experimental.UtilityClass;

import java.util.List;

/**
 * @author zhaolong
 * @since 2022-09-06
 */
@UtilityClass
public class Constants {
  public static final String SEPARATOR = "/";
  public static final char SEPARATOR_CHAR = '/';
  public static final String LOG_ATTRIBUTE_NAME = "log";
  public static final String BCRYPT_PASSWORD_ENCODER_PREFIX = "bcrypt";
  public static final String REQUEST_ID_KEY = "requestId";

  public final String HTML_CONTENT_TEXT =
      """
            <!DOCTYPE html>
            <html lang="en">
            <head>
                <meta charset="UTF-8">
                <title>Title</title>
                <style>
                    div{
                        white-space:pre-wrap;
                    }
                    .box{
                        // background-color:red;
                        padding: 10px;/*主要用于说明获取宽高的问题*/
                    }
                </style>
            </head>
            <body>
            <div class="box" id="div1">{}</div>
            </body>
            <script>
                document.addEventListener('DOMContentLoaded',function(){
                    var oDiv = document.getElementById('div1');
                    //alert(oDiv.clientWidth);//有padding的时候是180px，没有padding的时候是160px
                    oDiv.style.fontSize= "40px";
                    oDiv.style.position = "absolute";
                    oDiv.style.left = "50%";
                    oDiv.style.top = "50%";
                    oDiv.style.marginLeft =  -(oDiv.clientWidth/2) + "px";
                    oDiv.style.marginTop =  -(oDiv.clientHeight/2) + "px";
                },false);
            </script>
            </html>
            """;
  public final String REDIS_CACHE_NAME = "oula-bot";

  public final List<String> LUNCH =
      List.of(
          "四菜一汤", "馅饼", "小碗菜", "苏氏牛肉面", "武圣羊汤", "粉面", "山西面乡", "醉面", "便利蜂", "晋汉子", "无名缘米粉", "小谷姐姐");
  public final List<String> QR_CODE_LIST = List.of("山西面乡", "醉面", "食堂", "晋汉子");
  public final String BOT_WEBSOCKET_URL = "ws://127.0.0.1:9003";
  public final String BOT_BASE_URL = "127.0.0.1:9004";
  public final String AT_EXPRESSION = "[CQ:at,qq={}]";
  public final String IMG_EXPRESSION = "[CQ:image,file={}]";
  public final String REPLY_EXPRESSION = "[CQ:reply,id={}][CQ:at,qq={}]";
  public final String GROUP_ID_JOB_DATA_KEY = "BotMessageGroupId";
}
